#include <helpers\game\screen.h>

namespace DelGE
{
	namespace Helpers
	{
		namespace Game
		{
			void Screen::ChangeScreen(int iScreenIndex)
			{
				DelGEEvent oEvent;
				oEvent.eType = DelGE_Event_Game_ChangeScreen;
				oEvent.ScreenData.pData = this;
				oEvent.ScreenData.iScreenIndex = iScreenIndex;
				EventManager::PushEvent(oEvent);
			}

			void Screen::QuitGame()
			{
				DelGEEvent oEvent;
				oEvent.eType = DelGE_Event_Game_Quit;
				oEvent.GameData.pData = this;
				EventManager::PushEvent(oEvent);
			}

			void Screen::SwitchToFullscreen()
			{
				DelGEEvent oEvent;
				oEvent.eType = DelGE_Event_Game_SwitchToFullscreen;
				oEvent.GameData.pData = this;
				EventManager::PushEvent(oEvent);
			}

			void Screen::SwitchToWindowed()
			{
				DelGEEvent oEvent;
				oEvent.eType = DelGE_Event_Game_SwitchToWindowed;
				oEvent.GameData.pData = this;
				EventManager::PushEvent(oEvent);
			}

			void Screen::ToggleFullscreen()
			{
				DelGEEvent oEvent;
				oEvent.eType = DelGE_Event_Game_ToggleFullscreen;
				oEvent.GameData.pData = this;
				EventManager::PushEvent(oEvent);
			}

			int Screen::ScreenWidth()
			{
				return this->pEngine->GetGraphics()->GetCurrentContext()->GetWidth();
			}

			int Screen::ScreenHeight()
			{
				return this->pEngine->GetGraphics()->GetCurrentContext()->GetHeight();
			}

			void Screen::SetEngine(Engine *pEngine)
			{
				this->pEngine = pEngine;
			}
		}
	}
}